Skip to content

test: fix vacuous assertions in link_work_items and missing_tool#1644

Draft
github-actions[bot] wants to merge 1 commit into
mainfrom
test-reducer/vacuous-link-work-items-bd4c980140577e5f
Draft

test: fix vacuous assertions in link_work_items and missing_tool#1644
github-actions[bot] wants to merge 1 commit into
mainfrom
test-reducer/vacuous-link-work-items-bd4c980140577e5f

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

Test Suite Reduction: src/safe_outputs/link_work_items.rs + src/safe_outputs/missing_tool.rs

What was wrong

Five validation tests used bare assert!(result.is_err()) — a vacuous pattern that confirms some error occurs but does not verify the error message. A regression that changed the error path (e.g. returning a different error for the wrong reason) would pass these tests silently.

  • test_validation_rejects_zero_source_id (link_work_items): bare is_err(), no message check.
  • test_validation_rejects_zero_target_id (link_work_items): bare is_err(), no message check.
  • test_validation_rejects_same_ids (link_work_items): bare is_err(), no message check.
  • test_validation_rejects_invalid_link_type (link_work_items): bare is_err(), no message check.
  • test_params_requires_tool_name (missing_tool): bare is_err(), no message check.

Changes

Test File Action Reason
test_validation_rejects_zero_source_id link_work_items.rs Rewritten Bare is_err()unwrap_err() + "source_id must be positive" message check
test_validation_rejects_zero_target_id link_work_items.rs Rewritten Bare is_err()unwrap_err() + "target_id must be positive" message check
test_validation_rejects_same_ids link_work_items.rs Rewritten Bare is_err()unwrap_err() + "source_id and target_id must be different" message check
test_validation_rejects_invalid_link_type link_work_items.rs Rewritten Bare is_err()unwrap_err() + "invalid link_type" message check
test_params_requires_tool_name missing_tool.rs Rewritten Bare is_err().map()|().unwrap_err() + "tool_name" message check

Verification

  • cargo test: all tests pass ✅
  • cargo check: no errors ✅

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • spsprodeus21.vssps.visualstudio.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "spsprodeus21.vssps.visualstudio.com"

See Network Configuration for more information.

Generated by Test Reducer · 86.2 AIC · ⌖ 12.2 AIC · ⊞ 8.7K ·

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants